home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / EMSIF230.ARJ / EMSTEST.H < prev    next >
C/C++ Source or Header  |  1991-12-01  |  4KB  |  108 lines

  1. /***************************************************************************
  2. *   emstest.h                                                              *
  3. *   HEADER FOR tester for EMSIF                                            *
  4. *   OS:      DOS                                                           *
  5. *   VERSION: 1.1                                                           *
  6. *   DATE:    12/01/91                                                      *
  7. *                                                                          *
  8. *   Copyright (c) 1991 James W. Birdsall. All Rights Reserved.             *
  9. *                                                                          *
  10. *   Compiles under Borland C++ 2.0, TC 2.0, and MSC 6.00A.                 *
  11. *                                                                          *
  12. *   Header file for EMSTEST.                                               *
  13. *                                                                          *
  14. ***************************************************************************/
  15.  
  16. #ifndef EMSIF_H
  17.     **** ERROR **** MUST INCLUDE EMSIF.H BEFORE EMSTEST.H
  18. #endif
  19.  
  20. #ifndef EMSTEST_H
  21. #define EMSTEST_H
  22.  
  23. /*
  24. ** system includes <>
  25. */
  26.  
  27. /*
  28. ** custom includes ""
  29. */
  30.  
  31. /*
  32. ** local #defines
  33. */
  34.  
  35. /* at least 8 EMS pages must be free for all tests to be performed */
  36. #define MINFREE          8L
  37.  
  38. /* header and trailer messages for each test */
  39. #define TESTHEADER()     printf(">>>TEST #%d: %s\n", testno++, gblmsg)
  40. #define TESTTAILER()     printf("Test passed.\n")
  41.  
  42. /*
  43. ** This macro is for return checking for functions which are expected
  44. ** to succeed. It makes function calls to check if
  45. **      1) the function returned EMMOOPS
  46. **      2) the function returned a value that isn't EMMOOPS or 0
  47. **      3) the function set _EMMerror to an unexpected value
  48. ** The parameters are:
  49. **      fu  - char *, name of the function
  50. **      st  - status value returned by the function
  51. **      ex  - expected value of _EMMerror
  52. **      fr1 - conventional memory pointer to be freed on emergency exit
  53. **      fr2 - EMS handle to be freed on emergency exit
  54. **      fr3 - another EMS handle to be freed on emergency exit
  55. */
  56. #define TRIPLECHECK(fu, st, ex, fr1, fr2, fr3) \
  57.                          failcheck((fu), (st), (fr1), (fr2), (fr3)); \
  58.                          weirdretchk((fu), (st), (fr1), (fr2), (fr3)); \
  59.                          weirdcodechk((fu), (ex), (fr1), (fr2), (fr3))
  60.  
  61.  
  62. /*
  63. ** misc: copyright strings, version macros, etc.
  64. */
  65.  
  66. /*
  67. ** typedefs
  68. */
  69.  
  70. /*
  71. ** global variables
  72. */
  73.  
  74. /*
  75. ** static globals
  76. */
  77.  
  78. /*
  79. ** function prototypes
  80. */
  81.  
  82. extern void do_alloc_tests(unsigned long bytes);
  83. extern void do_palloc_tests(int pages);
  84. extern void do_frame_tests(void);
  85. extern void do_name_tests(void);
  86. extern void do_map_tests(void);
  87. extern void do_sr_tests(void);
  88. extern void do_shortcopy_tests(void);
  89. extern void do_longcopy_tests(void);
  90.  
  91. extern unsigned long test_EMMcoreleft(void);
  92. extern int test_EMMalloc(unsigned long bytes);
  93. extern int test_EMMallocpages(int pages);
  94. extern void test_EMMfree(int handle);
  95. extern void test_EMMmappage(int frameno, int handle, int logpage);
  96.  
  97. extern void weirdretchk(char *function, int status, void *tofree1, int tofree2,
  98.                                                                   int tofree3);
  99. extern void weirdcodechk(char *function, int expected, void *tofree1,
  100.                                                      int tofree2, int tofree3);
  101. extern void failcheck(char *function, int status, void *tofree1, int tofree2,
  102.                                                                   int tofree3);
  103. extern void nofailcheck(char *function, int status, void *tofree1, int tofree2,
  104.                                                                   int tofree3);
  105.  
  106. #endif
  107.  
  108.